const px2Rpx = (px) => {
    let {screenWidth} = wx.getSystemInfoSync()
    return px / (screenWidth / 750)
}
const rpx2px=(rpx)=>{
    let {windowWidth} = wx.getSystemInfoSync()
    return  rpx / 750 *windowWidth;
}
// 获取参数
const getQueryString = function (paramUrl, name) {
    let url = paramUrl
    if (url.indexOf('?') < 0) return name ? '' : {}
    let dataStr = url.split('?')[1]
    let dataArr = dataStr.split('&')
    let dataObj = {}

    for (let i = 0; i < dataArr.length; i++) {
        let a = dataArr[i].split('=')
        dataObj[a[0]] = a[1]
    }

    if (name) return dataObj[name]
    return dataObj
}
module.exports = {
    px2Rpx,
    rpx2px,
    getQueryString
}
